<?php

require_once dirname(__FILE__) . '/../_data/LzSqlTest.php';

$sql    = new LzTestClass('LzSqlTest');

LzTests::ln(
        $sql->parseCmpList(array('id' => 12)),
        $sql->parseCmpList(array('name' => 'john', 'pass' => md5('foo'))),
        $sql->parseCmpList(
            array(
                'pass' => md5('bar'),
                LzSql::raw('lower(name) = :name', array('name' => 'john'))
            )
        ),
        $sql->parseCmpList(
            array(
                'OR'    => array(
                    array('id' => 12),
                    array('name' => 'john', 'pass' => md5('foo')),
                    array(
                        'pass' => md5('foo'),
                        LzSql::raw('lower(name) = :name',
                                array('name' => 'john'))
                    )
                )
            )
        )
    );

var_dump($sql->data);
?>
---EXPECT---
|id| = :BIND0
|name| = :BIND1 AND |pass| = :BIND2
|pass| = :BIND3 AND lower(name) = :name
((|id| = :BIND5) OR (|name| = :BIND6 AND |pass| = :BIND7) OR (|pass| = :BIND8 AND lower(name) = :name))
array(9) {
  ["BIND0"]=>
  int(12)
  ["BIND1"]=>
  string(4) "john"
  ["BIND2"]=>
  string(32) "acbd18db4cc2f85cedef654fccc4a4d8"
  ["BIND3"]=>
  string(32) "37b51d194a7513e45b56f6524f2d51f2"
  ["name"]=>
  string(4) "john"
  ["BIND5"]=>
  int(12)
  ["BIND6"]=>
  string(4) "john"
  ["BIND7"]=>
  string(32) "acbd18db4cc2f85cedef654fccc4a4d8"
  ["BIND8"]=>
  string(32) "acbd18db4cc2f85cedef654fccc4a4d8"
}

